

package cn.iocoder.yudao.module.apijson.framework;


/**简单断言工具类，不用额外引入 JUnit 等库
 * @author Lemon
 */
public class AssertUtil {

	public static void assertEqual(Object a, Object b) {
		assertEqual(a, b, null);
	}
	
	public static void assertEqual(Object a, Object b, String errorMessage) {
		if (a == b) {
			return;
		}

		if (a == null || !a.equals(b)) {
			throw new AssertionError(errorMessage == null ? "assert fail: a != b" : errorMessage);
		}
	}

}
